The present invention relates to a data input/output system in a computer system and more particularly to a data input/output control system in an operating system for executing a data input/output based on a data input instruction to a main storage and a data output instruction from the main storage, the data input and output instructions being issued by a program.
A batch process, the most generally available data process, does not deal immediately with data every time when the data is produced, but with data comprising a certain number of grouped units. For example, where the sales status of goods is recognized, the data is grouped for processing in units of weeks or months.
When the units are shorter than those stated above, data grouped in certain units are outputted as a file to an external storage apparatus such as a magnetic disc. After the file is completed, the data in the file can be processed. It is then possible to execute a data input program for processing the data in a file after executing a data output program to store them into the file.
FIG. 1 shows a structural block diagram of a basic sequential access method (BSAM) of the first prior art data input and output control system. A computer comprising central processor unit 1, main storage unit 2 and memory control unit 3 are connected as shown. The inside of main storage unit 2 comprises user memory portion 4 and operating system.memory portion 5. User memory unit 4 comprises program memory unit 6 and data memory unit 7. A program named data managing portion 8, which is a part of an operating system (OS), is stored in the operating system memory portion. A program named job task managing portion 9 for managing an initiation and completion of the program, and which is also a part of the operation system is stored in operating system memory portion 5. Further, memory data portion 10, which is used by these two managing portions 8 and 9, is provided. Data input and output means transfer data between peripheral apparatuses of a computer, i.e. between file 12 in magnetic disc apparatus 11 and data memory portion 7 within user memory portion 4 in FIG. 1. The input and output is defined from the viewpoint of data memory portion 7. Magnetic disc control apparatus 13 actually transfers the data between magnetic disc apparatus 11 and memory control apparatus 3. File name memory portion 14 stores the name determined by the user for file 12 within magnetic apparatus 11. Data managing unit 8 comprises open processing portion 15, writing processing portion 16, reading processing unit 17 and close processing unit 18.
FIG. 2 is an operational view for explaining how data is written, namely, how data is outputted from main storage apparatus 2 in FIG. 1. Writing program 19, produced by an operating system in program memory unit 6 and initiated by the user, performs an initializing process as a sequence previously programmed by the user and issues an OPEN instruction. When it receives an OPEN instruction to prepare a file designated by an instruction parameter, open processing unit 15 of data managing unit 8 for the operating system confirms that the magnetic disc apparatus 11 storing the file is available for use and that a file of the same name does not already exist in file name memory unit 14. Then open processing unit 15 stores the address of the area of file 12 in magnetic disc apparatus 11 which can be used for storing the file in the storing area address 20 of data storing unit 10 and returns a control to writing program 19. Then, writing program 19 designates that DATA (1) is requested to be outputted from predetermined address of data memory unit 7 of user memory unit 4 and issues a WRITE instruction. Writing process unit 16 refers storing area address 20 of data store unit 10 and writes the same content as data (1) in the corresponding address of file 12, thereby providing DATA (1). In a similar manner to the above, DATA (2) is formed from data (2) data storing unit 7 and DATA (3) is formed from data (3). Tereafter, writing program 19 issues a CLOSE instruction as data to be written expires. Close process unit 18, which receives CLOSE instruction, writes a code representing a data end (called end of file or EOF) in file 12 and also writes the file name and storing address of file 12 in magnetic disc apparatus 11 in file name storing unit 14 as a form of file control block 21 so that other programs can read them. Thereafter, it returns the control to writing program 19. Then, writing program 19 completes executing a follow-up process, issues a RETURN instruction to declare a completion and is deleted from program memory unit 6 by job task managing unit 9.
FIG. 3 shows a drawing for explaining an operation in which data reading, namely, data input to main storage unit 2, is performed in the structure shown in FIG. 1. Reading program 22 entered into program memory unit 6 by a user is not always immediately initiated. When writing program 19, shown in FIG. 2, is being executed under the same file name as that used by reading program 22, the initiation is kept waiting by job task management 9. Depending on the designation, reading program 22 is kept waiting until writing program 19 issues a RETURN instruction or until writing program 19 issues a CLOSE instruction.
When reading program 22 is initiated, an initial process is executed as a sequence previously programmed by the user and then an OPEN instruction is issued. When open process unit 15 of data managing unit 8 of the operating system receives the OPEN instruction, it confirms that magnetic disc apparatus 11 in which the designated file is stored is available for use and file control block 21 having the particular name of the file already exists in file name storing unit 14, and that file 12 exists. Then, file name memory unit 14 stores the address of the area in which the file is stored in the magnetic disc apparatus 11, in data memory unit 10 and returns the control to reading program 22. Reading program 22 issues a READ instruction by requesting that an item of data be inputted to data memory unit 7 in the user memory unit. Reading unit 17 refers to the area address 20 in data memory unit 10, reads DATA (1) from the corresponding address of file 12 and informs the same content of DATA (1) to data memory unit 7. Similarly, data (2) is formed from DATA (2) and data (3) is formed by DATA (3). Thereafter, reading program 22 issues a READ instruction to read another data element without recognizing the number of data. Then, data does not exist in file 12, so a code of data end (EOF) appears. Thus, reading process unit 17 does not transfer the data, but notifies reading program 22 of "data end". Upon receipt of this notice, reading program 22 issues a CLOSE instruction. Close process unit 18 receives the CLOSE instruction and immediately returns the control to reading program 22. Thereafter, when reading program 22 completes the follow-up process and declares the completion by issuing a RETURN instruction, the process is extinguished by job task management unit 9.
If a job control language designates that reading program 22 is to be initiated immediately after the end of writing program 19 when the user initiates writing program 19, job task management unit 9, which is a program of the designated name from a program library, automatically initiates it immediately after writing program 19 issues RETURN instruction and declares the end of the program. In contrast, when writing program 19 does not reach the end in a normal manner because of an error in the data given by the program or the designation of the stop of execution by the operator, namely, in the case of an abnormal end, reading program 22 using the same file 12 often should not be initiated. In such a case, after the reason for the abnormal ending is deleted, it is necessary to execute writing program 19 again and rewrite file 12 correctly. At this time, job task management unit 9 detects the abnormal state and does not automatically initiate reading program 22.
The above automatic initiation is called a job step control or job control. Two programs having output and input relationships and stored in the same file should necessarily be kept waiting in such a sequential control. Thus, it is usual for a user to write in a job control language that these programs are the job or the job steps to be sequentially executed. Therefore, when writing program 19 of FIG. 2 is completed, reading program 22 for inputting the file is initiated by job task management unit 9. Therefore, there is a problem that the user cannot obtain the result of the completion of two programs unless he waits for a time period equal to the sum of the execution time of both programs 19 and 22.
FIG. 4 is a timing chart showing the above defects of the prior art. In FIG. 4, a temporary high portion of the graph designates that the process is being operated. The circular mark and the arrow show that a start and stop of an operation designated by the head of the arrow mark is conducted by using a start or stop of the operation designated by the circle mark as a trigger. It is supposed that the two programs comprising writing program and reading program are initiated concurrently at the first stage. However, the open process of reading program is kept waiting (as shown by the star mark in FIG. 4) until all the data in the file is written.
FIG. 5 explains "pipe", which is the second prior art of the data input and output control method. A computer storage device comprises user memory apparatus 31, utility memory apparatus 32, shell memory apparatus 33, and kernel memory apparatus 34. The storage apparatus is connected to keyboard apparatus 41 and display apparatus 42. Let us suppose that user 36 provides command 35 as an instruction at the designation of the computer instruction in the form of "cat/pr-l22" from keyboard apparatus 41. In this case, the command is transferred from user memory apparatus 31 to shell memory apparatus 33 and is interpreted in shell command analysis unit 37. The function of "cat", which is the first step in command 35, is to "read a character string from a standard input file and output it to a standard output file" "pr-l22", which is the second command means, "read a standard input file and display it in a standard output file after changing the format to the predetermined format of 22 rows per page". A special symbol ".vertline.", which combines these two portions means "operates by making a standard output file of the program executed by the command written on the left side of the symbol to correspond to the standard input of the program executed by the command written on the right side of the symbol. These two commands may be operated simultaneously, namely, by parallel processing." Shell command analysis unit 37 is an analytical process. It recognizes such designation. "cat" process programs (namely, utility) by using the function of kernel and "pr" utility is produced in an operation unit having, for example, the name of processes P1 and P2 and is arranged in utility memory apparatus 32. An input of process P1 is made to correspond to keyboard apparatus 41 as the standard input file. The standard output 38 from process P1 is inputted to a pipe, namely, a communication path between processes, which is newly set in kernel memory apparatus 34. On the other hand, standard input 39 to process P2 is made to correspond to the output from pipe 40. This operation enables the pipe to connect two processes. Further, display 42 is assigned to the standard output of process P2. When the pipe receives input data, it outputs them without keeping them waiting. Therefore, in this situation, when user 36 inputs a plurality of characters using keyboard apparatus 41, the data written into process P1 by WRITE, is quickly processed by a READ instruction of process P2, independently of how far process P1 advances. Therefore, processes P1 and P2 are processed in parallel.
"pipe" shown in FIG. 5 is a well-known technology, but it has the defect that only programs written by using input instruction READ of the standard input file and output instruction WRITE of the standard output file can be used.
The batch-type READ and WRITE instructions in the first prior art are different in function from READ instruction and WRITE instruction in the above recited pipe, although their spellings are similar. The operating system having a "pipe" function, recited in the second prior art, does not have a job control function for operating the batch program and therefore both batch function and job control function are inconsistent. The terminology "batch" is used in the operating system having a pipe function but this designates a function in which, if a shell command is previously collected and registered, then they can be called in a group. However, it cannot realize the batch type input function provided by a different operating system under the name "BSAM" in the prior art. Therefore, although the terminologies of "batch" are overlapped, the batch used in the operating system having the batch function is completely irrelevant to the data input and output control method according to the present invention. As a method of controlling an input and output in a batch-type manner, in addition to the above recited basic sequence access method, there are a basic partition access method (BPAM) for performing a sequential access after the partition member is found, a basic direct access method (BDAM) for performing a retrieval by designating an address or key, and a queued sequence access method (QSAM) for performing an access in units of records. These methods are similar in that they keep an open process of reading program waiting until all the data of the file is written, as shown in FIG. 4.
An online method of the third prior art of the data input and output control method is explained by referring to FIG. 6. A plurality of processes P1, P2, P3, P4 . . . P43 to P46 constituting a system, exchange messages between each other by going through buffer 47 or files. According to this method, it is possible for other processes, for example, process P2 44 to read by READ instruction a message which is outputted to buffer 47 by process P1 43, namely, to perform a parallel process of writing programs and reading programs.
However, in an online method, in order to transfer and receive the message between a plurality of processes it is necessary for the kind of the message and the identification of the destination of the message to be provided in the inside of the input and output data or an environment file corresponding to a program. The corresponding relationship between the output and input programs is not particularly well defined. For example, when the message transfer from process P1 43 to process P3 45 is completed, there is a possibility that the message transfers, for example, from process P4 46 to process P3 45, thereby making it difficult to complete the input program of the point P3 45. Because of these differences, it is impossible to realize an online method of input and output parallel processes by using the batch type input and output control method which is the object of the present invention.
In the prior art batch type data input and output control method, namely, the method for allowing a start of the execution of the program for inputting the data of the file after all the data constituting the file prepared by the program is outputted, it is impossible to perform a parallel processing between a file output program and a file input program for processing the file data. Thus, there is a problem that it takes longer to execute the whole process than where a parallel processing is possible.